// 文件预览
<template>
    <f7-page class="hntsh">
        <f7-navbar>
            <f7-nav-left>
                <f7-link back icon-material="chevron_left" force></f7-link>
            </f7-nav-left>
            <f7-nav-title>文件预览</f7-nav-title>
            <f7-nav-right> </f7-nav-right>
        </f7-navbar>
        <div class="content-list">
            <iframe :src="`static/pdfjs/web/viewer.html?file=${path}`" style="border: 0px !important; margin-top: 2px"
                width="100%" height="600px"></iframe>
        <!-- <f7-toolbar position="bottom" no-shadow class="fff">
        <f7-button fill class="submit-btn" @click="download()"
          >下载见证记录表</f7-button
        >
              </f7-toolbar> -->
        </div>
    </f7-page>
</template>

<script>
import controller from "@/libs/framework/workflowController";
import Config from "@/libs/config.js";
import Upload from "@/libs/framework/upload.js";

export default class instance extends controller {
    onInit () { }
    mixin () {
        return {
            data () {
                return {
                    path: "",
                };
            },

            mounted () {
                this.path = `${Config.api.download}/${this.$f7route.query.attachmentId}`;
            },
            methods: {
                //下载见证记录表
                download () {
                    window.location.href = `${Config.api.download}?attachmentId=${this.$f7route.query.attachmentId}`;
                    // Upload.idDownload(
                    //   null,
                    //   self.$f7route.query.attachmentId,
                    //   true,
                    //   function (task) {
                    //     console.log(task, 11);
                    //     self.$toast(`下载完成，文件名为${task.filename}`);
                    //   }
                    // );
                },
            },
        };
    }
}
</script>

<style lang="less" scoped>
@deep: ~">>>";

.hntsh {
    .submit-btn {
        flex: 1;
        margin: 0 10px;
        border-radius: 24px;
    }
}
</style>
